import React, { FC, useCallback } from 'react';
import { View, Text, Image } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
import CardWrap from '@/components/CardWrap/CardWrap';
import UserInfo from './UserInfo/UserInfo';
import Taro from '@tarojs/taro';
import { UserInfo_Web } from '@/pages/_server/_class/Mine/UserInfo';
export interface IProps extends ICompProps {
    userInfo: Partial<UserInfo_Web>;
}
Header.defaultProps = {} as Partial<IProps>;
function Header(props: IProps) {
    const { className, style, userInfo } = props;
    const localClassName = useClassName('Header', className);
    const click = useCallback(() => {
        var value = Taro.getStorageSync('token');
        if (!value) return;
        Taro.navigateTo({
            url: 'pages/ChagePersonalInfo/ChagePersonalInfo',
        });
    }, []);
    return (
        <RootView className={localClassName} style={style}>
            <View onClick={click}>
                <CardWrap leftSolt={<UserInfo userInfo={userInfo}></UserInfo>}></CardWrap>
            </View>
        </RootView>
    );
}
export default React.memo(Header as FC<IProps>);
const RootView = styled(View)`
    &.Header {
        margin-bottom: 70px;
    }
`;
